<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
		.table-list{border:1px solid #dddddd; border-collapse:collapse}
		.table-list td {padding:0;border:1px solid #dddddd;text-align:center;vertical-align:middle;}
		.table-list tr.theader td {font-weight: bold; background-color: #efefef;text-align:left;padding:5px 10px;}
		h2 {text-transform:uppercase; font-size: 180%}
    </style>
</head>
<body>
<h2 align="center">Thống kê theo domain</h2>
<div align="center">Từ ngày <?php echo date('d/m/Y', strtotime($fromdate));?> đến ngày <?php echo date('d/m/Y', strtotime($todate));?>
</div><br /><br />
<?php $n_label = count($label); if($n_label > 0){?>
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="table-list">
    <tr class="theader">
        <td width="30">Stt</td>
        <?php foreach ($label as $title){?>
        <td><?php echo $title;?></td>
        <?php }?>
    </tr>
   <?php $i = 0; foreach ($items as $item){ $i++;?>
    <tr>
        <td><?php echo $i;?></td>
        <?php $ii = 0; foreach ($label as $title){ $ii++;?>
        <td style="text-align:<?php echo (is_numeric($item->$title) ? 'right' : 'left'); ?>"><?php
        	echo (is_numeric($item->$title) && $n_label > $ii ? number_format($item->$title) : $item->$title);?>
        </td>
        <?php }?>
    </tr>
    <?php }?>
</table>
<?php }	//end if?>
</body>
</html>